<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="xm"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath() %>/css/backnav.css">
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath() %>/css/admin.css">
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath() %>/css/admincategoryList.css">
<script type="text/javascript">
	function deleteCate(categoryId){
		if(confirm("您是否确认删除类别")){
			location.href='<%=request.getContextPath()%>/adminFilter/admin_merchandise?m=deleteCate&categoryId='+categoryId;
		}
	}
	
	function addCate(){
		alert("成功");
	}
</script>
</head>
<body>
 	<div id="top">
 		<jsp:include page="/comm/backTop.jsp"></jsp:include>
 	</div>
    <div id="left">
        <jsp:include page="/comm/backnav.jsp"></jsp:include>
    </div>
    <div id="right">
        <div class="right">
        	<div class="main">
		 	 	 <table border="1">
		 	 	 	 <tr>
		 	 	 		<td class="td-th" colspan="4">商品类别维护</td>			
		 	 	 	</tr>
		 	 	 	 <tr>
		 	 	 	 	 <th>类别ID</th>
		 	 	 	 	 <th>类别名称</th>
		 	 	 	 	 <th colspan="2">操作</th>
		 	 	 	 </tr>
		 	 	 	 <xm:forEach items="${cateList }" var="cat">
		                <tr>
		                   <td>${cat.id }</td>
		                   <td>${cat.cateName }</td> 
		                   <td>
		                       <a href="javascript:deleteCate(${cat.id })">删除</a>
		                   </td>
		                    <!-- <td>
		                       <a href="javascript:deleteCate(${cat.id })">删除</a>
		                   </td>
		                    -->
		                </tr>
               		 </xm:forEach>
	 	       	</table>
	 	       	<div>
	 	       	<form action="<%=request.getContextPath() %>/adminFilter/admin_merchandise?m=addCate" method="post">
		 		 <table border="1">
		 		 	<tr>
		 	 	 		<td class="td-th" colspan="2">添加商品新类别</td>			
		 	 	 	</tr>
		 	 		<tr>
	                     <td width="300px">类别ID：</td>
	                     <td class="td-td"><input value="" name="cateId""> </td>
               	 	</tr>    
               	 	<tr>
	                     <td width="300px">类别名称：</td>
	                     <td class="td-td"><input value="" name="cateName"> </td>
               	 	</tr>      
		 	 	</table>
		 	 	
	 	       	</div>
		 	 	<div class="saveDiv">
		 	 		<button onclick="addCate()">添加</button>
		 	 	</div>
		 	  </form>
	 	 	</div>
        </div>
    </div>
</body>
</html>
